package com.campus.service.impl;

import com.campus.entity.TManagerTeacher;
import com.campus.mapper.TeacherMapper;
import com.campus.service.ITeacherService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements ITeacherService {

    @Autowired
    private TeacherMapper teacherMapper;

    @Override
    public int createTeacher(Integer id, String teacherName, String subject, String profession, String school, String introduce, Integer loginId) {

        TManagerTeacher tManagerTeacher = new TManagerTeacher();
        tManagerTeacher.setId(id);
        tManagerTeacher.setIntroduce(introduce);
        tManagerTeacher.setLoginId(loginId);
        tManagerTeacher.setProfession(profession);
        tManagerTeacher.setSchool(school);
        tManagerTeacher.setSubject(subject);
        tManagerTeacher.setTeacherName(teacherName);

        return teacherMapper.createTeacher(tManagerTeacher);
    }

    @Override
    public List<TManagerTeacher> queryTeacher(Integer id, String teacherName, String subject) {
        return teacherMapper.queryTeacher(id, teacherName, subject);
    }
}
